
package fileby.gui.tabs;

import com.google.inject.Inject;
import fileby.ctrl.tabs.ITabContentListenerProvider;
import fileby.core.IDisplayableFileSource;
import fileby.ctrl.actions.IActionProvider;
import fileby.ctrl.transferhandlers.ITransferHandlerProvider;
import fileby.util.properties.IPropertyBundleProvider;

/**
 *
 * @author Jacob
 */
public class TabFactory {

    IActionProvider actionProvider;
    ITransferHandlerProvider transferHandlerProvider;
    IPropertyBundleProvider propertyBundleProvider;
    ITabContentListenerProvider tabContentListenerProvider;
    TabItemFactory tabItemFactory;
    //ITabItemProvider tabItemProvider;

    @Inject
    public TabFactory(IActionProvider actionProvider, 
            ITransferHandlerProvider transferHandlerProvider,
            IPropertyBundleProvider propertyBundleProvider,
            ITabContentListenerProvider listenerProvider,
            TabItemFactory tabItemFactory) {

        this.transferHandlerProvider = transferHandlerProvider;
        this.actionProvider = actionProvider;
        this.propertyBundleProvider = propertyBundleProvider;
        this.tabContentListenerProvider = listenerProvider;
        this.tabItemFactory = tabItemFactory;
    }

    TabContent createTabContent(IDisplayableFileSource s) {
        return new TabContent(s, actionProvider, transferHandlerProvider,
                tabContentListenerProvider, tabItemFactory);
    }

    TabComponent createTabComponent(IDisplayableFileSource s){
        return new TabComponent(s, transferHandlerProvider, propertyBundleProvider,
                actionProvider);
    }

}
